package com.sky.mapper;


import com.sky.dto.GoodsSalesDTO;
import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@Mapper
public interface OrderDetailMapper {

    /**
     * 批量插入订单详情数据
     * @param orderDetailList
     */
    void insertBatch(ArrayList<OrderDetail> orderDetailList);


    /**
     * 查询订单详情
     * @param id
     * @return
     */
    @Select("select * from order_detail where order_id=#{id}")
    List<OrderDetail> getByOrderId(Long id);

    /**
     * 指定时间内销售榜前10
     * @param map
     * @return
     */
    List<GoodsSalesDTO> getSalesTop10(HashMap<String, Object> map);
}
